include nesdefines.s

; ---------- ZERO PAGE -------------
ENUM VM_TOP
;	VM_BTM: .dsb $20
;	VM_TOP: .db 0
	PAL_BUF: .dsb $20
	FRAMES: .db 0
	FRAMECNT=FRAMES
	PPU_CTRL_VAR: .db 0
	PPU_MASK_VAR: .db 0
	SCROLL_X: .db 0
	SCROLL_Y: .db 0
	SRC: .dw 0
	OAM_ATTR_FLAGS: .db 0
	OAM_PTR: .db 0
	CURRENT_BANK: .db 0

	TEMP0: .db 0
	TEMP1: .db 0
	TEMP2: .db 0
	TEMP3: .db 0
	TEMP4: .db 0
	TEMP5: .db 0
	TEMP6: .db 0
	TEMP7: .db 0
	TEMP8: .db 0
	TEMP9: .db 0
	TEMP10: .db 0
	TEMP11: .db 0

	OBJ_INDEX: .db 0  ; current object #, offset into interleaved array of byte properties

	PAD_STATE: .db 0
	PAD_STATEL: .db 0

; objects
	NUM_OBJECTS = 10
	OBJXlow: .dsb NUM_OBJECTS
	OBJXhigh: .dsb NUM_OBJECTS
	OBJYlow: .dsb NUM_OBJECTS
	OBJYhigh: .dsb NUM_OBJECTS
	OBJVXlow: .dsb NUM_OBJECTS
	OBJVXhigh: .dsb NUM_OBJECTS
	OBJVYlow: .dsb NUM_OBJECTS
	OBJVYhigh: .dsb NUM_OBJECTS
	OBJType: .dsb NUM_OBJECTS


ENDE
; ----------------------------------

NES_MAPPER=2  ; UNROM

.db $4e,$45,$53,$1a        ; NES,eof
;4
.db 8 ;NES_PRG_BANKS  - 128KB
.db 0 ;NES_CHR_BANKS  - no CHR ROM
.db 3|NES_MAPPER<<4 ;flags 6 - vertical mirroring, battery backed SRAM
.db $08 ; NES 2.0
;8
.db 0
.db 0
.db $07 ;8KB BATTERY BACKED
.db $70 ;8KB CHR RAM NOT BATTERY BACKED
;12
.db 0,0,0,0

base $8000
include bank00.s
pad $c000

base $8000
pad $c000

base $8000
pad $c000

base $8000
pad $c000

base $8000
pad $c000

base $8000
pad $c000

base $8000
pad $c000

; last bank
base $c000
include bank07.s


